Programming basics

New* methods

Retail3000 is created since 2005 and was (and still is) one of the first fully open API platforms for retail. The technology we had to use in 2005 was 'Webservices' and so called 'generics' where not available. The problem we were facing is what value do we give an integer type to notice that we intent not supply a value? Assigning a 'null' value is not possible on standard C# integers. Because of that, we have agreed to use the value of '-1' for integers to indicate that we do not want to supply a value.

The result of this choice is that it's very important to initialize an object with the correct default values. This has to do with adding new objects, but also on search methods.

New*Info methods

So when adding a Brand for example, start the adding method with request the method 'NewBrandInfo'.  With the result object, fill in the required values and submit the object to Retail3000 by calling 'AddBrand'.

New*Filter methods

The same is for searching data. A search method has a filter objecet. The content of the filter object needs to be initialized correctly. For example, to find Brands, first create a filter object by calling 'NewBrandsFilter'. Then set the search criteria in the retrieved search object and post it to 'GetBrands'.

Future changes

In 2019, we expect a midlife update from the Retail3000 platform in which we are going to move from Webservices to a combination of WCF and REST. In some other satelite applications, we have already learned how to achieve this and we have built knowledge about this technology.

Together with the move to WCF and REST, we are also going to introduce 'Generics' to the outside interfaces. This means that for example instead of using Integers, we are going to use generic Integers. When using generic Integers, a 'null' value can be assigned to indicate that we do not want to supply a value. This also means it's no longer required to call a 'New' method first: by just instantiating an object, all property values will have a 'null' value by default.

Although this documentation references an Integer as an example, the same is for all other types, like booleans, datetimes, decimals etc.

Soap signatures

Another downside of Webservices (and the reason WCF is introduced) is versioning. Retail3000 has only 1 version of the Webservices connector. On new versions, it's possible that the Webservices signatures might change. We do our very best to keep backward compatibility, but on some occasions this is not possible. And yes, on some occasions we simply forget tho do so, we are also only humans ;)

When WCF will be introduced in 2019, we will also introduce 'endpoints'. On each new version/update of Retail3000, we will create a new endpoint with all the new and changed functionality. The signature of already existing endpoints will never be changed and will be supported until further notice. Off course the result of this is that new and changed functionality can only be used by changing to the new endpoint.

Testing

Because of the current approach of using a -1 for Integer types and not having implemented generics, it's very hard to do automated (unit) testing. With the introduction of WCF and REST in combination with Generics, it's very simple to do automated unit-testing. This will result in more reliable updates. We expected the first unit tests on critical parts of Retail3000 to be written and applied in 2019 also.